import Vue from 'vue'
import VueRouter from 'vue-router'
import Create from '@/views/index/Create'
import Login from '@/views/index/Login'
import Home from '@/views/index/Home'
import Publish from '@/views/index/Publish'
import Statistics from '@/views/index/Statistics'
import Write from '@/views/index/Write'
import Success from '@/views/index/Success'
import Recycle from '@/views/index/Recycle'
// import { component } from 'vue/types/umd'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: Login
  },
  {
    path: '/admin/create',
    name: '创建问卷',
    component: Create
  },
  {
    path: '/admin/home',
    name: '主页',
    component: Home
  },
  {
    path: '/admin/recycle',
    name: '问卷回收站',
    component: Recycle
  },
  {
    path: '/admin/publish',
    name: '发布',
    component: Publish
  },
  {
    path: '/admin/statistics',
    name: '统计',
    component: Statistics
  },
  {
    path: '/project/write',
    name: '填写问卷',
    component: Write
  },
  {
    path: '/success',
    name: '成功页面',
    component: Success
  },
  {
    path: '/parser',
    name: 'parser',
    component: () => import(/* webpackChunkName: "parser-example" */'@/components/parser/example/Index.vue')
  },
  {
    path: '/tinymce',
    name: 'tinymce',
    component: () => import(/* webpackChunkName: "tinymce-example" */'@/components/tinymce/example/Index.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
